package com.jpsl.core;

import com.mysema.commons.lang.CloseableIterator;
import com.querydsl.core.*;
import com.querydsl.core.types.*;
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.core.types.dsl.BooleanOperation;
import com.querydsl.jpa.JPQLQuery;

import java.util.Collection;
import java.util.List;

/**
 * 查询接口
 *
 * @param <T>
 * @author 懒王猫
 */
public interface JPSLQuery<T> extends JPQLQuery<T> {

    @Override
    JPSLQuery<T> from(EntityPath<?>... sources);

    @Override
    <P> JPSLQuery<T> from(CollectionExpression<?, P> target, Path<P> alias);

    @Override
    <P> JPSLQuery<T> innerJoin(EntityPath<P> target);

    @Override
    <P> JPSLQuery<T> innerJoin(EntityPath<P> target, Path<P> alias);

    @Override
    <P> JPSLQuery<T> innerJoin(CollectionExpression<?, P> target);

    @Override
    <P> JPSLQuery<T> innerJoin(CollectionExpression<?, P> target, Path<P> alias);

    @Override
    <P> JPSLQuery<T> innerJoin(MapExpression<?, P> target);

    @Override
    <P> JPSLQuery<T> innerJoin(MapExpression<?, P> target, Path<P> alias);

    @Override
    <P> JPSLQuery<T> join(EntityPath<P> target);

    @Override
    <P> JPSLQuery<T> join(EntityPath<P> target, Path<P> alias);

    @Override
    <P> JPSLQuery<T> join(CollectionExpression<?, P> target);

    @Override
    <P> JPSLQuery<T> join(CollectionExpression<?, P> target, Path<P> alias);

    @Override
    <P> JPSLQuery<T> join(MapExpression<?, P> target);

    @Override
    <P> JPSLQuery<T> join(MapExpression<?, P> target, Path<P> alias);

    @Override
    <P> JPSLQuery<T> leftJoin(EntityPath<P> target);

    @Override
    <P> JPSLQuery<T> leftJoin(EntityPath<P> target, Path<P> alias);

    @Override
    <P> JPSLQuery<T> leftJoin(CollectionExpression<?, P> target);

    @Override
    <P> JPSLQuery<T> leftJoin(CollectionExpression<?, P> target, Path<P> alias);

    @Override
    <P> JPSLQuery<T> leftJoin(MapExpression<?, P> target);

    @Override
    <P> JPSLQuery<T> leftJoin(MapExpression<?, P> target, Path<P> alias);

    @Override
    <P> JPSLQuery<T> rightJoin(EntityPath<P> target);

    @Override
    <P> JPSLQuery<T> rightJoin(EntityPath<P> target, Path<P> alias);

    @Override
    <P> JPSLQuery<T> rightJoin(CollectionExpression<?, P> target);

    @Override
    <P> JPSLQuery<T> rightJoin(CollectionExpression<?, P> target, Path<P> alias);

    @Override
    <P> JPSLQuery<T> rightJoin(MapExpression<?, P> target);

    @Override
    <P> JPSLQuery<T> rightJoin(MapExpression<?, P> target, Path<P> alias);

    @Override
    JPSLQuery<T> on(Predicate... condition);

    @Override
    JPSLQuery<T> fetchJoin();

    @Override
    JPSLQuery<T> fetchAll();

    @Override
    <U> JPSLQuery<U> select(Expression<U> expr);

    @Override
    JPSLQuery<Tuple> select(Expression<?>... exprs);

    @Override
    <S> S transform(ResultTransformer<S> transformer);

    @Override
    List<T> fetch();

    @Override
    T fetchFirst();

    @Override
    T fetchOne() throws NonUniqueResultException;

    @Override
    CloseableIterator<T> iterate();

    @Override
    QueryResults<T> fetchResults();

    @Override
    long fetchCount();

    @Override
    JPSLQuery<T> groupBy(Expression<?>... o);

    @Override
    JPSLQuery<T> having(Predicate... o);

    @Override
    JPSLQuery<T> limit(long limit);

    @Override
    JPSLQuery<T> offset(long offset);

    @Override
    JPSLQuery<T> restrict(QueryModifiers modifiers);

    @Override
    JPSLQuery<T> orderBy(OrderSpecifier<?>... o);

    @Override
    <P> JPSLQuery<T> set(ParamExpression<P> param, P value);

    @Override
    JPSLQuery<T> distinct();

    @Override
    JPSLQuery<T> where(Predicate... o);

    @Override
    BooleanExpression eq(Expression<? extends T> expr);

    @Override
    BooleanExpression eq(T constant);

    @Override
    BooleanExpression ne(Expression<? extends T> expr);

    @Override
    BooleanExpression ne(T constant);

    @Override
    BooleanExpression contains(Expression<? extends T> right);

    @Override
    BooleanExpression contains(T constant);

    @Override
    BooleanExpression exists();

    @Override
    BooleanExpression notExists();

    @Override
    BooleanExpression lt(Expression<? extends T> expr);

    @Override
    BooleanExpression lt(T constant);

    @Override
    BooleanExpression gt(Expression<? extends T> expr);

    @Override
    BooleanExpression gt(T constant);

    @Override
    BooleanExpression loe(Expression<? extends T> expr);

    @Override
    BooleanExpression loe(T constant);

    @Override
    BooleanExpression goe(Expression<? extends T> expr);

    @Override
    BooleanExpression goe(T constant);

    @Override
    BooleanOperation isNull();

    @Override
    BooleanOperation isNotNull();

    @Override
    BooleanExpression in(Collection<? extends T> right);

    @Override
    BooleanExpression in(T... right);

    @Override
    QueryMetadata getMetadata();

    @Override
    <R, C> R accept(Visitor<R, C> v, C context);

    @Override
    Class<? extends T> getType();

}
